//
//  TMGOrderTableViewCell.m
//  TMGold
//
//  Created by Mac on 2017/12/11.
//  Copyright © 2017年 tangmu. All rights reserved.
//

#import "TMGOrderTableViewCell.h"
@interface  TMGOrderTableViewCell()
@property(nonatomic, strong) STLabel                     *typeLable;
@property(nonatomic, strong) STLabel                     *timeLable;
@property(nonatomic, strong) STLabel                     *moneyLable;
@property(nonatomic, strong) STLabel                     *statusLable;
@end

@implementation TMGOrderTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 70;
}
#pragma mark --subView
- (void)configSubView{
    
    self.typeLable = [[STLabel alloc] initWithFrame:CGRectMake(15, 15, 300, 17)
                                                     text:@"卖金"
                                                textColor:TM_firstTextColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.typeLable];
    
    
    self.timeLable = [[STLabel alloc] initWithFrame:CGRectMake(15, 15, 300, 15)
                                               text:@"2017-12-11 09:42:08"
                                          textColor:TM_secendTextColor
                                               font:14
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentLeft];
    self.timeLable.top = self.typeLable.bottom  +10;
    [self addSubview:self.timeLable];
    
    
    self.moneyLable = [[STLabel alloc] initWithFrame:CGRectMake(15, 15, 300, 15)
                                               text:@"￥678"
                                          textColor:TM_redColor
                                               font:18
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentRight];
    self.moneyLable.right = UIScreenWidth - 15;
    self.moneyLable.centerY = self.typeLable.centerY;
    [self addSubview:self.moneyLable];
    
    self.statusLable = [[STLabel alloc] initWithFrame:CGRectMake(15, 15, 300, 15)
                                               text:@"交易失败"
                                          textColor:TM_secendTextColor
                                               font:14
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentRight];
    self.statusLable.top = self.moneyLable.bottom  +10;
    self.statusLable.right = UIScreenWidth - 15;
    [self addSubview:self.statusLable];
    
}
- (void)setModel:(TMGOrderModel *)model{
    _model = model;
    self.typeLable.text = model.name;
    self.timeLable.text = model.create_at;
    self.moneyLable.text =  [NSString stringWithFormat:@"￥%@",model.price];
    self.statusLable.text = model.status;
}
@end
